1. Field of the Invention
The present invention relates to an image processing method capable of correcting and changing white balance output, an image processing program, an image processing apparatus, an imaging apparatus, an imaging method, and an imaging program.
2. Description of the Related Art
In the related art, in imaging apparatuses (video cameras, digital cameras, or the like) for electrically obtaining an imaging signal, processing called white balance has typically been performed so that the color of an image becomes more natural. The white balance processing is processing for adjusting balance of R (red color), G (green color), and B (blue color) components of image data so that the color of a white object photographed under a light source at a certain color temperature is photographed as a white color without color imbalance.
White balance will now be described briefly. First, color temperature will be described. Color temperature is the color of radiation light emitted from a complete black body when the complete black body is heated, and the color and the temperature are defined by the relationship of 1:1. The temperature at which a complete black body emits radiation light of a particular color is termed color temperature and is measured in units of “K” (Kelvin), which is the unit of thermodynamic temperature. The chromaticity of the color of the radiation light from a complete black body changes from red to white, and further to blue as the temperature of the complete black body increases. For this reason, a screen with strong overall redness can be expressed as “having a low color temperature”, and a screen with strong overall blueness can be expressed as “having a high color temperature”. The color temperature of a typical light source is, for example, approximately 2800K with a 60 W tungsten incandescent lamp, approximately 5600K with daylight sunlight, and approximately 6500K with a fluorescent lamp of daytime color.
FIG. 20 shows changes in color temperature due to black body radiation as the relationship between red color (R) and blue color (B), which is based on green color (G). In FIG. 20, the vertical axis indicates R, and the horizontal axis indicates B. Color temperature decreases toward the left side along the curve, and color temperature increases toward the right side. Changes in the color temperature shown in FIG. 20 are hereinafter referred to as blackbody radiation. As described above, the blackbody radiation forms a curve of a non-linear complex shape.
In actual white balance processing, it is common practice that one color (for example, G) among the components of R, G and B is fixed, and the other two colors (for example, R and B) can be changed along the blackbody radiation, thereby relative adjustment of the balance of each color of R, G, and B is realized. In Japanese Unexamined Patent Application Publication No. 2005-130317, a technology in which natural color reproduction is realized by performing appropriate white balance adjustment when an infrared cut filter is used.
As described above, since the blackbody radiation forms a non-linear complex curve, the relationship between R and B and the relationship between color temperature and R and B becomes nonlinear. As a consequence, a problem arises in that computations performed when white balance output is corrected and changed become very complex.
A case is considered in which a user specifies that color temperature is corrected in a state in which white balance is achieved in a predetermined light source environment. For example, first, the levels of an R signal and a B signal in a state in which white balance is currently achieved are obtained. Next, the color temperature after correction is determined with the amount of correction specified by the user, and the levels of the R signal and the B signal corresponding to the color temperature are calculated. Then, the amount of correction of the gains of the R signal and the B signal is determined on the basis of the R signal and the B signal in a state in which white balance is achieved and on the basis of the R signal and the B signal after correction by the user.
In such a case, for example, a computation when each of the levels of the R signal and the B signal is determined from the specified color temperature is performed on the basis of the blackbody radiation. Furthermore, a computation is performed for checking whether or not the R signal and the B signal when white balance is achieved in the current light source environment lies along the blackbody radiation. Also, when the R signal and the B signal do not lie on the blackbody radiation, a predetermined correction computation is performed on the basis of blackbody radiation.
As described above, in processes for correcting and changing white balance output, various computations are performed on the basis of the nonlinear blackbody radiation. In particular, in a portable video camera and digital camera, since it is considered that it is difficult to install a CPU (Central Processing Unit) capable of high-speed computation, there is a risk that processing can take a long time.
In order to easily perform computations for correcting and changing white balance output, as an example is shown in FIG. 21, a method for approximating blackbody radiation with a plurality of linear straight lines may also be used. In the example of FIG. 21, the blackbody radiation (indicated by the dotted line) are approximated with three linear straight lines S1, S2, and S3. Since each of the linear straight lines S1, S2, and S3 can be expressed by a simple first-order equation, the computation can be performed easily and at a high speed.
However, even in this method, there is a problem in that a large deviation occurs with blackbody radiation at a connection point between two straight lines, and a correction calculation needs to be performed in the connection portion. Another problem is how the correction calculation is performed.
Furthermore, even in the method for approximating the blackbody radiation with a straight line, it is difficult to avoid the relationship between an R signal and color temperature and the relationship between a B signal and color temperature from becoming nonlinear as a whole. Therefore, some way of counteracting this trend becomes necessary, for example, the relationship between the B signal and color temperatures is formed as a table and stored in a memory in advance, or computations are performed at several divided blocks corresponding to the levels of the B signals, and it is difficult to avoid the computations from becoming complex. Furthermore, it is also a problem that, how case separations are performed on color temperature and how block divisions are performed.
Accordingly, it is preferable to provide an image processing method capable of easily correcting and changing white balance output values, an image processing program, an image processing apparatus, an imaging apparatus, an imaging method, and an imaging program.